# 文件路径问题
# 获取当前脚本所在路径的目录
import os.path

folder = os.path.dirname(__file__)
# print('当前脚本所在路径的目录:', folder)
# 法1：拼接路径
# with open(folder+'\\text1', 'r', encoding='utf-8') as file:
#     content = file.read()
#     print(content)

# 法2：拼接路径
with open(os.path.join(folder, 'text1'), 'r', encoding='utf-8') as file:
    content = file.read()
    print(content)